home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 008a / nlh14.zip / NLH.DOC < prev    next >
Text File  |  1992-01-23  |  19KB  |  619 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.                           --------------------------
  17.                           |          N L H         |
  18.                           |      N A T U R A L     |
  19.                           |     L A N G U A G E    |
  20.                           |    H Y P E R T E X T   |
  21.                           --------------------------
  22.                           (Version 1.4  17-Jan-1992)
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. Natural Language HyperText
  31. ==========================
  32. This  program  allows  user  to  get  quickly proper answers, writing specific 
  33. questions  using  common  natural  language,  then  NLH  allow him to navigate 
  34. answers via HyperText technique.
  35.  
  36.  
  37.  
  38.  
  39. Fee and Licence
  40. ===============
  41. This  package  is  completely free of charge. No bureaucracy, no constraint no 
  42. legal  issue  can  prevent  you  to  make  any copy you want. I made it for my 
  43. pleasure  spending  my RS&S days (Raining Saturdays & Sundays). I ask you only 
  44. one thing; to translate the following old Latin Cicerone's phrase :
  45.  
  46.  
  47. "Plerique  amicos, tanquam pecudes, eos potissimum diligunt, ex quibus sperant 
  48. se maximum fructum esse capturos" (Cicero 106 B.C.)
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                                                            Maurizio Ammannato
  59.  
  60.  
  61.  
  62.  
  63.  
  64. Two programs
  65. ============
  66. This  package  consists  of  two  main  programs : NLC.EXE to create a new ADB 
  67. (Answer  Data  Base) and NLH.EXE to execute Natural Language HyperText. To use 
  68. NLH, refer to NLUSERI.DOC (Italian) or NLUSERE.DOC (English).
  69.  
  70.  
  71.  
  72. Keywords
  73. ========
  74. Before  starting  to  describe  the  source  file  structure  let me make some 
  75. considerations  on  how to capture the 'meaningful words' of a generic phrase. 
  76. I  want  to  build an answer for the question "What communications port have I 
  77. to  use?". Well, 1) I know the question is about a trouble, 2) we are speaking 
  78. about  a  communications  package, 3) if the question is about port is because 
  79. the user wants to use this port.
  80.  
  81. Looking  at this example we can conclude that it is enough to use the one-word 
  82. "PORT" keyword to identify related answer.
  83.  
  84.  
  85. If  I  have  to  answer  to  the  following  question:  "How  can  I change my 
  86. communications  port  parity?",  we  probably have to use "CHANGE PARITY" as a 
  87. two-words keyword to identify proper answer.
  88.  
  89. If  instead  the  question  is about: "How can I change my communications port 
  90. data  bits?",  we  probably  have  to  use "CHANGE DATA BITS" as a three-words 
  91. keyword to identify proper answer.
  92.  
  93.  
  94. Finally  if  the  question  is:  "How can I access PCMB ADDRESS BOOK Basket?", 
  95. probably  I  have  to  use "PCMB ACCESS ADDRESS BASKET" four-words keyword, to 
  96. identify  proper  answer.  I can obviously have different keywords pointing to 
  97. same answer, i.e. :
  98.  
  99.  
  100. '-------------------
  101. @#$
  102. Access Address Basket                            (First Keyword)
  103. This basket......................
  104. .................................
  105. .................................
  106. ..............................ok?
  107. '-------------------
  108. @#$
  109. Address Book Basket                              (2nd Keyword)
  110. @SEE:Access Address Basket
  111. '-------------------
  112. @#$
  113. Access Book Basket                               (3rd Keyword)
  114. @SEE:Access Address Basket
  115.  
  116.  
  117. above  structure  allows  all  3  of three-words keywords to point to the same 
  118. answer.
  119.  
  120.  
  121.  
  122.  
  123.  
  124. Master Keyword
  125. ==============
  126. When  NLH user writes his question into the Bottom Input Window, he can get an 
  127. answer or he cannot get any answer (if NLH didn't find any keyword at all).
  128.  
  129. You  can  decide  to use Master Keyword option to let user to get an answer in 
  130. ANY CASE. That's why of Master Keyword.
  131.  
  132.  
  133.                         ******************************
  134.                         ONLY ONE MASTER KEYWORD FOR DB
  135.                         ******************************
  136.  
  137.  
  138. Simply  enclose  that  Master  Keyword  between  two  '@' (decimal 64, without 
  139. quotes) to use this option.
  140.  
  141.  
  142. In  PCMB.SRC  source  Answer  Data  Base  I've chosen 'Troubleshooting' as the 
  143. Master Key and it looks like :
  144.  
  145. @#$
  146. @Troubleshooting@
  147. ........................................................
  148. ........................................................
  149. @#$
  150.  
  151.  
  152.  
  153. Now when user doesn't get any answer, the Troubleshooting text appears.
  154. Take  this opportunity to write that Master Text very clearly, detailed with a 
  155. lot  of  Text  Keywords  (see  below)  to allow user to navigate up to closest 
  156. answer to his question.
  157.  
  158.  
  159. A  part  of  that,  the  Master  Key  is  a key like any other (you can access 
  160. directly  this  keyword  from input text or you can enclose it between |....|, 
  161. like an usual Text Keyword, etc).
  162.  
  163.  
  164.  
  165.  
  166.  
  167. Creating New ADB
  168. ================
  169.  
  170.  
  171.  
  172.         ***************************************************************
  173.         Source ADB file must be ASCII, any filename with .SRC extension
  174.         ***************************************************************
  175.  
  176.  
  177. Take  your preferred Text Editor or Word Processor  capable to export document 
  178. in ASCII, listable, printable file (i.e. C:\NL\PE2 pippo.src).
  179.  
  180. An  NLH  Answer  Data Base consists of two main parts. The first one describes 
  181. the  words  (from  user  input)  that  NLH has to replace before executing the 
  182. searching process.
  183.  
  184. For  example  Quik-Comm  is an ADB keyword. The user can write correctly Quik-
  185. Comm or also QuikComm or QuickComm or QC etc.
  186.  
  187. To  facilitate NLH search, you can instruct it to replace all above words with 
  188. the Quik-Comm correct word in the following way :
  189.  
  190.  
  191. '--------------------- beginning of source PIPPO.SRC file (ASCII)
  192. @REPLACE-START@
  193. QuikComm,Quik-Comm
  194. QuickComm,Quik-Comm
  195. Quik-Com,Quik-Comm
  196. QC,Quik-Comm
  197. file,files
  198. driver,drivers
  199. diskette,disk
  200. communication,communications
  201. respond,answer
  202. ....................
  203. ....................
  204. @REPLACE-END@
  205.  
  206.  
  207. Once  NLH  gets  question from bottom window, word by word looks for its alias 
  208. (if exists), then replaces it accordingly to above list.
  209.  
  210.  
  211.  
  212.                  *********************************************
  213.                  FIRST word will be replaced by the SECOND one
  214.                  *********************************************
  215.  
  216.  
  217.  
  218.  
  219.  
  220. For example if you write in the REPLACE section :
  221.  
  222. ...................
  223. QuickComm,Quik-Comm
  224. ...................
  225.  
  226. that  means  each  time  NLH  receives  the  input word "QuickComm" from user, 
  227. replaces that with "Quik-Comm" word, then NLH starts the search.
  228.  
  229.  
  230. Once  declared  alias  list  you  can start creating the Answer Data Base body 
  231. part.
  232.  
  233.  
  234. Any answer has three parts:
  235.  
  236.  
  237.             ******************************************************
  238.             1) ANSWER SEPARATOR, 2) ANSWER KEYWORD, 3) ANSWER BODY
  239.             ******************************************************
  240.  
  241.  
  242.  
  243.  
  244.  
  245. ANSWER SEPARATOR
  246. ================
  247. Use  the  @#$  character  string  on  top  of  new  answer  to  let program to 
  248. understand where the old question ends and where the new one starts.
  249.  
  250.  
  251.  
  252. ANSWER KEYWORD
  253. ==============
  254. It's  the  keyword to be searched. It can be a one-word keyword (i.e. PORT) or 
  255. two-words    keyword   (i.e.   PORT   NUMBER),   three-words   keyword   (i.e. 
  256. COMMUNICATIONS  PORT NUMBER) or finally a four-words keyword (i.e. MODIFY PCMB 
  257. ADDRESS BOOK).
  258.  
  259.                 ***********************************************
  260.                 AN ANSWER KEYWORD CAN HAVE A MAXIMUM OF 4 WORDS
  261.                 ***********************************************
  262.  
  263.  
  264. ANSWER BODY
  265. ===========
  266. It  is  the text of the answer which can have up to 78 characters per line and 
  267. INFINITE lines. Just and example :
  268.  
  269.  
  270.                    ****************************************
  271.                    IT DOESN'T MATTER OF KEYWORD WORDS ORDER
  272.                    ("Comm Port" is the same of "Port Comm)"
  273.                    ****************************************
  274.  
  275.  
  276.  
  277. '-------------------
  278. @#$                                              1st) ANSWER SEPARATOR
  279. Communications Port                              2-WORDS KEYWORD
  280. First answer row......................
  281. ......................................           ANSWER BODY
  282. Last answer row.......................
  283. '-------------------
  284. @#$                                              2nd) ANSWER SEPARATOR
  285. Port                                             1-WORD KEYWORD
  286. First answer row......................
  287. ......................................           ANSWER BODY
  288. Last answer row.......................
  289.  
  290.  
  291.  
  292.  
  293.                 ***********************************************
  294.                 PRINT PCMB.SRC FILE FOR A COMPLETE REAL EXAMPLE
  295.                               (C:\PRINT PCMB.SRC)
  296.                ************************************************
  297.  
  298.  
  299.  
  300.  
  301.  
  302. Special Keys
  303. ============
  304. As  told  before, you can have more keywords pointing to same answer. You have 
  305. only to use "@SEE:" command followed by pointed keyword. An example :
  306.  
  307.  
  308.  
  309. '-------------------------------------- any ' means comment
  310. @#$
  311. Communications Port
  312. First answer row....................
  313. ....................................
  314. ....................................
  315. ....................................
  316. ....................................
  317. Last answer row.....................
  318. '-----------------------------------
  319. @#$
  320. Communication Port
  321. @SEE:Communications Port
  322. '-----------------------------------
  323. @#$
  324. Telecommunication Port
  325. @SEE:Communications Port
  326. '-----------------------------------
  327. @#$
  328. Communication Board
  329. @SEE:Communications Port
  330. '-----------------------------------
  331. @#$
  332. Port
  333. @SEE:Communications Port
  334. '-----------------------------------
  335. @#$
  336. UART
  337. @SEE:Communications Port
  338.  
  339.  
  340.  
  341. Who  makes  the  question  and  writes "Communications Port" or "Communication 
  342. Port"   or   "Port"  or  "Ports"  etc..  gets  always  proper  answer  without 
  343. duplicating sometime a long answer for each of these similar questions.
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350. Text Keyword
  351. ============
  352. Sometime  it  is  useful to let user navigate more than one window letting him 
  353. to  go in depth of the explanation with more details. Let imagine your user is 
  354. asking  something  on  communication  port  :  "How  can  I  change  data bits 
  355. communications parameters?"
  356.  
  357.  
  358.  
  359. @#$
  360. Communications Data Bits
  361. You can change these communication parameter is the following way :
  362. ...................................................................
  363. Other than data bits you probably have also to change parity. See
  364. also |Changing Parity| keyword etc.................................
  365.  
  366.  
  367.  
  368. Writing  a word between two '|' (decimal 124) you can mark this text word as a 
  369. keyword.  When  user  will  press  ENTER  key  NLH  looks for this keyword and 
  370. displays  a  new window with a second answer. Obviously "Changing Parity" MUST 
  371. exist  in  the  ADB. At this moment you cannot have more than 100 keywords per 
  372. screen.
  373.  
  374.  
  375.  
  376. Text Keyword Type
  377. =================
  378. There are three types of Text Keywords : text, program and image keywords.
  379.  
  380.  
  381. 1) Text Keyword
  382. ---------------
  383. It's exactly the same example as before. An Example :
  384.  
  385. "Other  than  this explanation, see also : |Change Parity|" (and Change Parity 
  386. is another keyword with related text and eventually other text keywords).
  387.  
  388.  
  389.  
  390. 2) Program Keyword
  391. ------------------
  392.  
  393.  
  394.             ******************************************************
  395.             PROGRAM KEYWORDS MUST HAVE .EXE .COM OR .BAT EXTENSION
  396.             ******************************************************
  397.  
  398.  
  399. If  the  keyword has one of above extensions, NLH simply SHELL (executes) this 
  400. program and at its end comes back exactly at the same point. An Example:
  401.  
  402. "Now  if you have well understood, execute |TX.EXE| program and pressing twice 
  403. F2 keys, come back here for comments!"
  404.  
  405.  
  406.  
  407.  
  408.  
  409. 3) Image Keyword
  410. ----------------
  411.  
  412.  
  413.                     ***************************************
  414.                     IMAGE KEYWORDS MUST HAVE .SCR EXTENSION
  415.                     ***************************************
  416.  
  417.  
  418. Can  be useful (and PCMB.ADB uses extensively this option) to display a screen 
  419. (of  the  program we are speaking about) exactly as it appears in the reality. 
  420. See ahead the use of NLW program. An example.
  421.  
  422. "Put  highlight  to SERVICES basket (|PCMB-R01.SCR| press ENTER now to see how 
  423. PCMB screen must looks like).........."
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430. NLW Program
  431. ===========
  432. This  TSR  (Terminate  and Stay Resident)  utility allows you to capture video 
  433. screens  to a file which MUST have .SCR extension. To capture for example PCMB 
  434. screens to be displayed using NLH, do as following.
  435.  
  436.  
  437. At DOS prompt execute C:>NLW.
  438. Then  execute PCMB. When you want to save current screen, press together Alt-B 
  439. (Alt  and  B  keys).  NLW  ask  for its filename then saves this file to disk. 
  440. Quitting  PCMB,  copy  all  these .SCR file to NL directory where programs and 
  441. DBs are. "NLW /U" to uninstal this program from memory.
  442.  
  443.  
  444. When  you  are  writing your answer data base put |PCMB-01.SCR| keyword in the 
  445. right  point,  then  when user will press this keyword, a standard PCMB screen 
  446. will appear. Any key to come back to the answer text of NLH package.
  447.  
  448.  
  449.  
  450.  
  451.  
  452. Updating Existing ADB
  453. =====================
  454. Simply  edit  .SRC  listable,  ASCII  source  file.  Make  your corrections or 
  455. updates, then save it again.
  456.  
  457.  
  458.  
  459.              ****************************************************
  460.              REMEMBER TO EXECUTE NLC.EXE PROGRAM AFTER ANY UPDATE
  461.              ****************************************************
  462.  
  463.  
  464.  
  465.  
  466.  
  467. Adding New Keywords
  468. ===================
  469. In  the same manner as told before, you can increase the knowledge of your ADB 
  470. appending  new  answers  to  client  new  questions,  without  any limit (just 
  471. physical hardware ones)
  472.  
  473.  
  474.  
  475.          ************************************************************
  476.          REMEMBER TO EXECUTE NLC.EXE PROGRAM AFTER ADDING NEW ANSWERS
  477.          ************************************************************
  478.  
  479.  
  480.  
  481.  
  482.  
  483. Compiling .SRC Source
  484. =====================
  485. Once  defined  all  the  possible  answers  in  the  "filename.SRC" Source ADB 
  486. (Answer Data Base) file
  487.  
  488.  
  489.              *****************************************************
  490.              SOURCE ADB MUST BE AN ASCII, LISTABLE, PRINTABLE FILE
  491.              *****************************************************
  492.  
  493.  
  494. put  this  file  in the same NLH programs directory (i.e. NLH directory), then 
  495. execute  NLC.EXE  followed by a space and the source filename to build the ADB 
  496. file and related indexes (for example C:\NLH\NLC PIPPO.SRC).
  497.  
  498.  
  499. NLC, if no errors, creates all needed files :
  500.  
  501. - PIPPO.ADB        the ADB with all the answers
  502. - PIPPO.AX1        1-word index file
  503. - PIPPO.AX2        2-words index file
  504. - PIPPO.AX3        3-words index file
  505. - PIPPO.AX4        4-words index file
  506. - PIPPO.WL         ADB used words list file (input words don't matching this
  507.                    file words, are discarded to speed up search process)
  508. - PIPPO.RL         to be replaced words list
  509. - PIPPO.MK         master keyword record
  510.  
  511.  
  512.  
  513. During compilation you can get two different errors :
  514.  
  515. 1)  @SEE: command is pointing to non existing keyword (pointed keyword must be 
  516. defined BEFORE @SEE: command)
  517.  
  518. 2) Text Keyword is pointing to non existing keyword (probably wrong text)
  519.  
  520.  
  521.  
  522.  
  523. NLC.CFG
  524. =======
  525. Look  at  this  ASCII  file  to  modify  language  or to change PRINTER ON/OFF 
  526. option.
  527.  
  528.  
  529.  
  530.  
  531.  
  532. For Technical People
  533. ====================
  534. All  programs are written in Quik Basic 4.5 language using QB4BAS and QuickPak 
  535. Assembler  routines  library  for  processing,  QBVID  'C'  routines for video 
  536. management  and  finally  my  routines  calling  DOS  INTERRUPT  services  for 
  537. windows.
  538.  
  539. The  Answer  Data  Base  file  is  a  random fixed-length text file pointed by 
  540. sorted  index files.  This file structure allows a very fast dichotomic search 
  541. (dichotomic  technique  takes, in the worst case, 16 random access to find one 
  542. record  between 100.000). That means that the ADB and related indexes can grow 
  543. CONSIDERABLY without increasing answer response time.
  544.  
  545.  
  546.  
  547. Searching Process
  548. -----------------
  549. Once  NLH gets a carriage return code from bottom input window, it divides the 
  550. phrase  word by word. Then tries to replace each word with its alias (if found 
  551. in .RL index file).
  552.  
  553. Then,  still  before starting search, confronts each input word with .WL index 
  554. and  discards  all  words  which  don't match that list (words not used in the 
  555. Answer Data Base keywords)
  556.  
  557. Finally  NLH starts searching 4-words at the time (it doesn't matter of order, 
  558. thus  user  can  write  "change  data bit value" or "bit change data value" or 
  559. "value  data  bit  change" up to 24 combinations) then if it doesn't find this 
  560. keyword,  it looks for 3-words at the time, then 2-words and finally it search 
  561. word by word.
  562.  
  563.  
  564.  
  565. An Example
  566. ----------
  567. User writes :
  568. How can I send and receive from Host my QC?
  569.  
  570. I Step:   NLH replaces "QC" with "mail" (first list in PCMB.SRC)
  571.  
  572. II Step:  NLH discards "can" "I" "and" "from" "my" because not found in
  573.           PCMB.WL index
  574.  
  575. III Step: now we have following phrase "HOW SEND RECEIVE HOST MAIL" and
  576.           NLH takes first 4 words and starts searching this 4-words 
  577.           keyword into .AX4 index for 24 time equal to 4-words combinations:
  578.  
  579.           A B C D    A C B D    A B D C    A C D B    A D B C    A D C B
  580.           B A C D    B C A D    B A D C    B C D A    B D A C    B D C A
  581.           C B A D    C A B D    C B D A    C A D B    C D B A    C D A B
  582.           D B C A    D C B A    D B A C    D C A B    D A B C    D A C B
  583.  
  584.  
  585. Then, if not found, takes other 4-words and again. If not found, then takes 3-
  586. words and their combinations, after 2-words and finally word by word.
  587.  
  588.  
  589.  
  590.  
  591. History
  592. =======
  593.  
  594.  
  595.          1.4  . Printer option for compiler (NLC) in the NLC.CFG file instead
  596.                 of screen prompt.
  597.               . Some cosmetic to NLC program.
  598.               . Better string length control for NLH program.
  599.               . Added NLH.CFI and NLC.CFI configurator files in Italian
  600.                 language (copy them to respectively NLC.CFG and NLH.CFG).
  601.  
  602.          1.3  . Fixed a bug when reading an ADB without REPLACE KEYWORDS
  603.                 section.
  604.               . Fixed a minor bug when reading comment lines in NLH.CFG file.
  605.               . Added Function Keys within Alt-keys (for some PCs not
  606.                 fully MS-DOS compatible). Print NLH.CFG to see changes.
  607.               . No more Exit Window when related messages is a null string.
  608.               . Added message when saving text to external file NLH.OUT.
  609.               . Rewritten Window Routines to increase speed.
  610.               . Printer not ready message.
  611.               . Revised documentation.
  612.               . Other minor cosmetics.
  613.  
  614.          1.2  . New utility and new management of Picture keywords (.SCR)
  615.  
  616.          1.1  . Cosmetics.
  617.  
  618.          1.0  . Initial version.
  619.